import pymssql

print('查询mssql')
db=pymssql.connect('localhost','sa','www.z01.com','zoomla2020')
#完整数据库连接方法是：
# conn=pymssql.connect(server='192.168.0.110', port=9526, user='sa', password='pwd', database='test')


cursor=db.cursor()
cursor.execute('select * from zl_user')
aa=cursor.fetchall()

print(aa)
for x in aa:
    print("会员ID:{userid},会员名：{username}".format(userid=x[0],username=x[1]))
cursor.close()
db.close()


# sql查询完整教程： https://blog.csdn.net/freeking101/article/details/81024386